home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / AppleScanGS / BoxCtrl.DefProc.mac < prev    next >
Encoding:
Text File  |  1990-05-27  |  4.2 KB  |  237 lines  |  [TEXT/MPS ]

  1. ; from E16.Control
  2.  
  3. octlOwner    EQU        4
  4. octlRect    EQU        8
  5. octlFlag    EQU        16
  6. octlHilite    EQU        17
  7. octlValue    EQU        18
  8. octlColor    EQU        36
  9. ctlInVis    EQU        $0080                ; invisible mask for any type of control 
  10. recSize        EQU        $000C                ; Return record size command.
  11.  
  12. ; from E16.Event
  13.  
  14. owhat        EQU        0
  15. owhere        EQU        10
  16. mouseUpEvt    EQU        $0002
  17. mUpMask        EQU        $0004
  18.  
  19. ; from E16.QuickDraw
  20.  
  21. oportRect    EQU        16                    ; PortRect
  22.  
  23. ; from E16.Window
  24.  
  25. owFrame        EQU        210
  26. noPart        EQU        $0000
  27. fHilited    EQU        $0001                ; Window is highlighted.
  28. fCtlTie        EQU        $0008                ; Window state tied to controls.
  29.  
  30. ; from M16.Control
  31.  
  32.  MACRO
  33. &lab _DragRect
  34. &lab ldx #$1D10
  35.      jsl $E10000
  36.  MEND
  37.  
  38. ; from m16.Event
  39.  
  40.  MACRO
  41. &lab _GetNextEvent
  42. &lab ldx #$0A06
  43.      jsl $E10000
  44.  MEND
  45.  
  46. ; from M16.IntMath
  47.  
  48.  MACRO
  49. &lab _UDivide
  50. &lab ldx #$0B0B
  51.      jsl $E10000
  52.  MEND
  53.  
  54. ; from m16.QuickDraw
  55.  
  56.  MACRO
  57. &lab _GetMasterSCB
  58. &lab ldx #$1704
  59.      jsl $E10000
  60.  MEND
  61.  MACRO
  62. &lab _SetPenState
  63. &lab ldx #$2A04
  64.      jsl $E10000
  65.  MEND
  66.  MACRO
  67. &lab _GetPenState
  68. &lab ldx #$2B04
  69.      jsl $E10000
  70.  MEND
  71.  MACRO
  72. &lab _SetPenSize
  73. &lab ldx #$2C04
  74.      jsl $E10000
  75.  MEND
  76.  MACRO
  77. &lab _SetPenMode
  78. &lab ldx #$2E04
  79.      jsl $E10000
  80.  MEND
  81.  MACRO
  82. &lab _SetPenPat
  83. &lab ldx #$3004
  84.      jsl $E10000
  85.  MEND
  86.  MACRO
  87. &lab _SetSolidPenPat
  88. &lab ldx #$3704
  89.      jsl $E10000
  90.  MEND
  91.  MACRO
  92. &lab _InsetRect
  93. &lab ldx #$4C04
  94.      jsl $E10000
  95.  MEND
  96.  MACRO
  97. &lab _PtInRect
  98. &lab ldx #$4F04
  99.      jsl $E10000
  100.  MEND
  101.  MACRO
  102. &lab _FrameRect
  103. &lab ldx #$5304
  104.      jsl $E10000
  105.  MEND
  106.  MACRO
  107. &lab _PaintRect
  108. &lab ldx #$5404
  109.      jsl $E10000
  110.  MEND
  111.  MACRO
  112. &lab _EraseRect
  113. &lab ldx #$5504
  114.      jsl $E10000
  115.  MEND
  116.  MACRO
  117. &lab _GlobalToLocal
  118. &lab ldx #$8504
  119.      jsl $E10000
  120.  MEND
  121.  
  122. ; from M16.Util
  123.  
  124. ;............................................................
  125. ;
  126. ;        Push long (4 bytes) onto stack
  127. ;
  128. ;    pushlong address             - push contents of address
  129. ;    pushlong address,x           - push contents of address,x
  130. ;    pushlong const,s             - push contents of stack+const    
  131. ;    pushlong #address/const      - push address or constant
  132. ;    pushlong [zeropage],offset   - push using indirect address
  133. ;...............................................................
  134.     MACRO
  135.     pushlong &addr,&offset
  136.     IF &addr[1:1]='#' THEN
  137.         pea        &addr[2:255]>>16
  138.         pea        |&addr[2:255]
  139.     ELSEIF &addr[1:1]='[' THEN
  140.         ldy        #&offset+2
  141.         pushword &addr,y
  142.         ldy        #&offset
  143.         pushword &addr,y
  144.     ELSEIF &offset='s' THEN
  145.         pushword &addr+2,s
  146.         pushword &addr+2,s
  147.     ELSEIF &offset='' THEN
  148.         pushword  &addr+2
  149.         pushword  &addr
  150.     ELSE
  151.         pushword &addr+2,&offset
  152.         pushword &addr,&offset
  153.     ENDIF
  154.     MEND
  155. ;...............................................................
  156. ;
  157. ;        Push 2 bytes onto stack
  158. ;
  159. ;    pushword loc     -- pushes bytes onto stack from 'loc'
  160. ;    pushword loc,x   -- pushes bytes onto stack from 'loc,x'
  161. ;    pushword #n      -- pushes constant #n onto stack
  162. ;    pushword         -- pushes bytes onto stack (from A)
  163. ;...............................................................
  164.     MACRO
  165.     pushword &addr,®
  166.     IF &addr[1:1]='#' AND &SETTING('LONGA')='ON' THEN
  167.         pea        |&addr[2:255]
  168.     ELSE
  169.         IF &addr≠'' THEN
  170.             IF ®≠'' THEN 
  171.                 lda        &addr,®
  172.             ELSE
  173.                 lda        &addr
  174.             ENDIF
  175.         ENDIF
  176.         pha
  177.     ENDIF
  178.     MEND
  179. ;...............................................................
  180. ;
  181. ;        Pull 2 bytes from stack
  182. ;
  183. ;    pullword loc     -- pulls bytes off stack and stores in 'loc'
  184. ;    pullword loc,x   -- pulls bytes off stack and stores in 'loc,x'
  185. ;    pullword         -- pulls bytes off stack and leaves in A
  186. ;...............................................................
  187.     MACRO
  188.     pullword &addr,®
  189.         pla
  190.     IF &addr≠'' THEN
  191.         IF ®≠'' THEN
  192.             sta        &addr,®
  193.         ELSE
  194.             sta        &addr
  195.         ENDIF
  196.     ELSEIF ®≠'' THEN 
  197.         AERROR 'Illegal 2nd parameter'
  198.     ENDIF
  199.     MEND
  200.  
  201. ; from M16.Window
  202.  
  203.  MACRO
  204. &lab _InvalRect
  205. &lab ldx #$3A0E
  206.      jsl $E10000
  207.  MEND
  208.  
  209. *
  210. * my own custom macros
  211. *
  212.  
  213. ; cmps - signed comparison
  214. ;        use just like the cmp instruction, but destroys contents of accumulator
  215. ;        conditions c and z flags just like the built in cmp instruction.
  216. ;
  217.  
  218.  MACRO
  219.     cmps    &oprnd                    ; signed comparison
  220.     sec
  221.     sbc        &oprnd
  222.     beq        @1
  223.     bvs        @2
  224.  if &Setting('LONGA')='OFF' then    ; must determine correct operand size
  225.      eor        #$80
  226.  else
  227.     eor        #$8000
  228.  endif
  229. @2
  230.     bmi        @greaterThan
  231.     clc
  232.     dc.b    $B0                        ; BCS opcode
  233. @greaterThan
  234.     sec
  235. @1
  236.     ENDM
  237.